package com.artron.mediaartron.ui.fragment.made.picture;

import android.os.Parcel;
import android.os.Parcelable;
import android.support.annotation.NonNull;

import com.bilibili.boxing.model.entity.impl.ImageMedia;

import java.io.File;

/**
 * Class description here
 *
 * @author doing
 * @version 1.0.0
 * @since 2017-12-08.
 */

public class ScaleMedia extends ImageMedia implements Parcelable{

    private double scale;

    public ScaleMedia(String id, String imagePath) {
        super(id, imagePath);
    }

    public ScaleMedia(@NonNull File file) {
        super(file);
    }

    public ScaleMedia(Builder builder) {
        super(builder);
    }

    protected ScaleMedia(Parcel in) {
        super(in);
        scale = in.readDouble();
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        super.writeToParcel(dest, flags);
        dest.writeDouble(scale);
    }

    @Override
    public int describeContents() {
        return 0;
    }

    public static final Creator<ScaleMedia> CREATOR = new Creator<ScaleMedia>() {
        @Override
        public ScaleMedia createFromParcel(Parcel in) {
            return new ScaleMedia(in);
        }

        @Override
        public ScaleMedia[] newArray(int size) {
            return new ScaleMedia[size];
        }
    };

    public double getScale() {
        return scale;
    }

    public void setScale(double scale) {
        this.scale = scale;
    }
}
